<?php
namespace app\before\validate;

use think\Validate;

class CouponGet extends Validate
{
    protected $rule = [
        'foreign_key' => 'require|number',
        'issue_user' => 'require|number',
        'get_user_id' => 'require|number',
        'coupon_code' => 'require',
        'status' => 'require',
        'add_time' => 'require|number',
    ];
    protected $message = [
        'foreign_key.require' => '优惠券ID为必填项',
        'foreign_key.number' => '优惠券ID需为数字',
        'issue_user.require' => '发布人id为必填项',
        'issue_user.number' => '发布人id需为数字',
        'get_user_id.require' => '领取人ID为必填项',
        'get_user_id.number' => '领取人ID需为数字',
        'coupon_code.require' => '核销编码为必填项',
        'status.require' => '状态  0：未使用  1：已使用为必填项',
        'add_time.require' => '领取时间为必填项',
        'add_time.number' => '领取时间需为数字',
    ];
    protected $scene = [
        'edit' => [
            'foreign_key',
            'issue_user',
            'get_user_id',
            'coupon_code',
            'status',
            'add_time',
        ],
    ];
}
